import request from '@/utils/request'
// 请求员工列表
export const getEmployeeListAPI = (params) => request.get('/sys/user', { params })
// 导出员工excel
// responseType: 'json'
// responseType: 'blob'
export const exportEmployeeAPI = () => request.get('/sys/user', { responseType: 'blob' })
// 下载员工导入模板
export const exportTemplateAPI = () => request.get('/sys/user/import/template', { responseType: 'blob' })
// 上传文件
export const uploadExcelAPI = (data) => request.post('/sys/user/import', data, {
  headers: {
    'Content-Type': 'multipart/form-data' // 正常请求的是json application/json格式
  }
})

// 删除员工
export const delEmployeeAPI = (id) => request.delete(`/sys/user/${id}`)
// 新增员工
export const addEmployeeAPI = (data) => request.post(`/sys/user`, data)
// 查看详情
export const getEmployeeAPI = (id) => request.get(`/sys/user/${id}`)
// 修改员工详情
export const updateEmployeeAPI = (id) => request.put(`/sys/user/${id}`)
